package com.kdzy.lshy.socity_server.controller;

import com.kdzy.lshy.socity_server.service.DepartmentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


@RestController
@RequestMapping(value = "/")
@CrossOrigin("*")
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    //部门查询
    @RequestMapping(value = "/findAllDepartment", method = RequestMethod.POST)
    public Object findDepartment(String param, HttpServletRequest request) {
        request.setAttribute("RETURN_PARAM", departmentService.getAllByCondition(param,request));
        return departmentService.getAllByCondition(param,request);
    }


    //    部门业务查询
    @RequestMapping(value = "/findByBizz", method = RequestMethod.POST)
    public Object findByBizz(String param, HttpServletRequest request) {

        return departmentService.findByBizz(param, request);

    }

    //    部门子业务查询
    @RequestMapping(value = "/findByChildBizz", method = RequestMethod.POST)
    public Object findByChildBizz(String param, HttpServletRequest request) {
        return departmentService.findByBizzs(param,request);
    }

    //    业务证件查询
    @RequestMapping(value = "/findByTestify", method = RequestMethod.POST)
    public Object findByTestify(String param, HttpServletRequest request) {
        return departmentService.findByTestify(param,request);
    }
}
